#!/usr/bin/env Python
# coding=utf-8

from methods.database.db import *

def select_table(table,  column,  condition,  value, other=' and 1=1'  ):
    sql = "select " + column + " from " + table + " where " + condition + "='" + str(value) + "'"
    sql+=other
    print(sql)
    cur.execute(sql)
    lines = cur.fetchall()
    return lines

def select_columns(table, column ):
    sql = "select " + column + " from " + table
    cur.execute(sql)
    lines = cur.fetchall()
    return lines

def insert_data(table, column,data ):
    sql = "insert into " + table + "("+column+") values( " + data+")"
    cur.execute(sql)
    conn.commit()